<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$template_dir = $this->baseurl.'/templates/'.$this->template.'/';
//echo $template_dir;

// get images from jos_banner
$db = &JFactory::getDBO();
$query = "SELECT * FROM #__banner WHERE catid=1 ";
$db->setQuery($query);
$row1 = $db->loadObjectList(); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="templates/valborghus/images/favicon.ico" />
<link rel="stylesheet" type="text/css" media="screen" href="templates/valborghus/css/styles.css" />
<link rel="stylesheet" type="text/css" media="screen" href="templates/valborghus/css/vmenu.css" />
<link rel="stylesheet" type="text/css" media="screen" href="templates/valborghus/css/typography.css" />
<link rel="stylesheet" href="templates/valborghus/css/default.css" type="text/css" media="screen" />
<link rel="stylesheet" href="templates/valborghus/css/nivo-slider.css" type="text/css" media="screen" />
<link rel="stylesheet" href="templates/valborghus/css/jquery.ui.datepicker.css" type="text/css" media="screen" />
<link rel="stylesheet" href="templates/valborghus/css/accordion.css" type="text/css" media="screen" />
<link rel="stylesheet" href="templates/valborghus/css/prettyPhoto.css" type="text/css" media="screen" />
<script type="text/javascript" src="templates/valborghus/js/jquery-1.6.1.min.js"></script>

<script type="text/javascript" src="templates/valborghus/js/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
$(window).load(function() {
	$('#slider').nivoSlider();
});
</script>

<script src="templates/valborghus/js/jquery.ui.datepicker.js"></script>
<script>
	$(function() {
		$( "#datepicker" ).datepicker();
	});
</script>

<script type="text/javascript" src="templates/valborghus/js/jquery.easing.js"></script>
<script type="text/javascript" src="templates/valborghus/js/jquery.dimensions.js"></script>
<script type="text/javascript" src="templates/valborghus/js/jquery.accordion.js"></script>
<script type="text/javascript">
	jQuery().ready(function(){
		jQuery('#list1b').accordion({
			autoheight: false
		});
	
		var accordions = jQuery('#list1b');
		
		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});
	});
</script>

<script src="templates/valborghus/js/jquery.prettyPhoto.js" type="text/javascript"></script>
<script type="text/javascript" >
	$(document).ready(function(){
		 jQuery(".lage-image").prettyPhoto();
		 
	});
</script> 
</head>
<body>

<div id="wrapper">
   <div id="header">
    <div class="inner clearfix">
        <h1 id="logo"><a href="index.php">Valborghus</a></h1>
    </div>
   </div><!--header-->  
    <div class="bg-cnt padt10">   
 <div id="top-container">
    <div class="inner clearfix">
    
        <div id="left-menu" class="fll">
		<jdoc:include type="modules" name="menu" />                    
        </div>       
        <div id="slideshow">
            <div class="slider-wrapper theme-default">			
                <div id="slider" class="nivoSlider">
							<?php 	
									
									//echo count($row1);exit;
									for($i=0;$i<count($row1);$i++){
							?>
                    <a href="<?php echo $row1[$i]->clickurl ?>"><img src="images/banners/<?php echo $row1[$i]->imageurl ?>" alt="" title="#htmlcaption<?php echo $row1[$i]->bid ?>" /></a>
                   <?php }?>
                </div>
							<?php 	
							//echo $row1[2]->bid;exit;
									for($i=0;$i<count($row1);$i++){									
							?>
				<div id="htmlcaption<?php echo $row1[$i]->bid ?>" class="nivo-html-caption">
                    <div class="circle">
                        <p><?php echo $row1[$i]->description ?></p>
                    </div>
                </div>
							<?php }?>
						
            </div>
        </div><!--slideshow-->       
    </div>
</div><!--top-container--><!--top-container-->       
        <div id="main-container" class="has-right">
            <div class="inner clearfix">
            
                <div id="main-body">
                    <div id="main-content">
                    	<jdoc:include type="component" />
                       
                    </div><!--main-content-->
                    
                </div><!--main-body-->
                
				<div id="sidebar-right">
					<div class="news">
						<div class="shadow"></div>
						<div class="inner-news">
							<div class="item">
									{module menu_right}		
							</div>
							<div class="item">
									{module menu_right_1}		
							</div>
						</div>
					</div>
					<div class="services">
						<h3 class="titlemod">Service</h3>
						<ul class="ul-reset">
									
									<?php 
									$db = &JFactory::getDBO();
									$query = "SELECT * FROM #__content AS content WHERE content.catid=5";
									$db->SetQuery($query);
									$row = $db->loadObjectList(); 
									///var_dump($row);exit;
									for($i=0;$i<count($row);$i++){	
									?>							
									<li><a href="index.php?option=com_content&view=article&id=<?php echo $row[$i]->id ?>&Itemid=1"><?php echo $row[$i]->title ?></a></li>									
									<?php }?>
						</ul>
					</div>
				</div><!--sidebar-right-->
            </div>    	        
        </div><!--main-container-->
    
    </div>
        
</div><!--wrapper-->

	<jdoc:include type="modules" name="foot" />
           <!--footer-->	
</body>
</html>
